package com.u.social.search.service;

import com.u.social.search.model.ArticleDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: u-social
 * @description: 召回逻辑
 * @author: Alex Wu
 * @createDate: 2025-04-11 14:21
 **/

@Service
public class RecallService {

    @Autowired
    private  AIApiService aiApiService;
    /**
     * 召回逻辑-文本相关性
     *
     * @param keyword 关键词
     * @return 召回结果
     */
    public List<ArticleDTO> getRecallByTextRelated(String keyword) {
        System.out.println("查询ES 召回");
        return new ArrayList<>();
    }

    /**
     * 召回逻辑-embedding-语义相关性
     *
     * @param keyword 关键词
     * @return 召回结果
     */
    public List<ArticleDTO> getRecallByEmbedding(String keyword) {
        System.out.println("转化为特征");
        List<ArticleDTO> semanticsEmbedding = aiApiService.getSemanticsEmbedding(new ArrayList<>());
        return semanticsEmbedding;
    }
}
